Cover TOC Chap Prev Chap Prev Fig Next Fig Next Chap

Chapter 13: Building Shapes with Points, Lines, and Faces

../ch13/13fig13.gif
Figure 13.13

A 3-D lightning bolt using concave faces.

13fig13.wrl
Click on the image to view the VRML scene.

#VRML V2.0 utf8
# The VRML 2.0 Sourcebook
# Copyright (c) 1997
# Andrea L. Ames, David R. Nadeau, and John L. Moreland
Shape {
    appearance Appearance {
        material Material {
            diffuseColor 1.0 1.0 0.0
        }
    }
    geometry IndexedFaceSet {
        coord Coordinate {
            point [
            # Lighting bolt tip
                0.0  0.0  0.0,
            # Front perimeter
                5.5  5.0  0.88,
                4.0  5.5  0.968,
                7.0  8.0  1.408,
                4.0  9.0  1.584,
                1.0  5.0  0.88,
                2.5  4.5  0.792,
            # Back perimeter
                5.5  5.0 -0.88,
                4.0  5.5 -0.968,
                7.0  8.0 -1.408,
                4.0  9.0 -1.584,
                1.0  5.0 -0.88,
                2.5  4.5 -0.792,
            ]
        }
        coordIndex [
        # Front
            0,  1,  2,  3,  4,  5,  6, -1,
        # Back
            0, 12, 11, 10,  9,  8,  7, -1,
        # Sides
            0,  7,  1, -1,
            1,  7,  8,  2, -1,
            2,  8,  9,  3, -1,
            3,  9, 10,  4, -1,
            4, 10, 11,  5, -1,
            5, 11, 12,  6, -1,
            6, 12,  0, -1,
        ]
        convex FALSE
    }
}